/*
 * Class of Animal:用来作为继承练习的上层基类。
 */
package chapter7_Reusing.extPacge;
import publicLibs.Color;
import publicLibs.p;

public class Animal {

	private String name = "Animal";
	private Color c = Color.RED;
	private int weight = 0;
	
	protected void movement(){
		p.p("The Animal moves.");
	}
	
	protected void jiaoSheng(){
		p.p("The Animal is barking");
	}
	
	public String toString(){
		String nl = "\r\n"; // newLine !
		String s = "I'm an animal," + nl;
		//[疑问]：如何让继承类的name替换为基类的name？
		s += "Name:" + this.name + nl;
		s += "Color:" + c + nl;
		s += "Weight:" + weight + nl;
		return s;
	}

}
